import request from '@neu/biz-core/utils/request'

// 模型树
export const tree = () => {
  return request({
    url: '/cmdb/schemas/tree/pure',
    method: 'get'
  })
}

export const locationTree = () => {
  return request({
    url: '/cmdb/instances/schema/location/tree/by/parent',
    method: 'get'
  })
}

// 按模型code及参数查询
export const listByScheam = (params, schemadefId) => {
  return request({
    url: '/cmdb/instances/schema/' + schemadefId,
    params,
    method: 'get'
  })
}

// 业务模型list
export const list = () => {
  return request({
    url: '/cmdb/businesses',
    method: 'get'
  })
}

// 业务模型详细信息
export const businessDetail = (code) => {
  return request({
    url: '/cmdb/businesses/' + code,
    method: 'get'
  })
}
